/*
 * @Description: 
 * @Author: HKH
 * @Date: 2024-09-05 11:09:35
 * @LastEditors: HKH
 * @LastEditTime: 2024-09-05 11:18:32
 */
public class erweihe {
    public static void main(String[] args) {
        // 定义一个二维数组
        int[][] array2D = {{1,2},{3,4},{9,6}};

        // 计算二维数组的和
        int sum = 0;
        for (int i = 0; i < array2D.length; i++) {
            for (int j = 0; j < array2D[i].length; j++) {
                sum += array2D[i][j];
            }
        }
        // 计算二维数组的平均值
        System.out.println("二维数组的和="+sum);
        double avg = (double) sum / (array2D.length * array2D[0].length);
        System.out.println("二维数组的平均值为: " + avg);
        // 计算二维数组的最大值
        int max = array2D[0][0];
        for (int i = 0; i < array2D.length; i++) {
            for (int j = 0; j < array2D[i].length; j++) {
                if (array2D[i][j] > max) {}
            }
        }
        // 输出结果
        System.out.println("二维数组的和为: " + sum);
    }
}